@extends('admin.layout')
@section('content')
<div class="col-md-12 col-sm-12 col-xs-12">
    <div class="panel panel-info">
        <div class="panel-heading">
            @if (count($errors) > 0)
                <div class="mws-form-message error">
                    出错啦!!!
                    <ul>
                        @foreach ($errors->all() as $error)
                        <li>{{$error}}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
        </div>
        <ol class="breadcrumb">
            <li>管理员</li>
            <li><a href="/admin/user">用户管理</a></li>
            <li class="active">用户修改</li>
        </ol>
        <div class="panel-body" style="width: 80%;">
            <form role="form" action="/admin/user/{{$user['id']}}" method="post" enctype="multipart/form-data">
                <div class="form-group">
                    <label>用户名</label>
                    <input class="form-control" type="text" name="username" value="{{$user['username']}}">
                </div>
                <div class="form-group">
                    <label>邮箱</label>
                    <input class="form-control" type="text" name="email" value="{{$user['email']}}">
                </div>
                <div class="form-group">
                    <label>电话</label>
                    <input class="form-control" type="text" name="phone" value="{{$user['phone']}}">
                </div>
                <div class="form-group">
                    <label>用户权限</label>
                    <select class="form-control" name="auth">
                        <option value="0" @if($user['auth'] == 0) selected @endif>普通用户</option>
                        <option value="1" @if($user['auth'] == 1) selected @endif>前台管理员</option>
                        <option value="2" @if($user['auth'] == 2) selected @endif>后台管理员</option>
                        <option value="3" @if($user['auth'] == 3) selected @endif>超级管理员</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>账号状态</label>
                    <div class="radio">
                        <label>
                            <input type="radio" name="status" id="optionsRadios1" value="0" @if($user['auth'] == 0) checked @endif>禁用
                        </label>
                        <label>
                            <input type="radio" name="status" id="optionsRadios2" value="1" @if($user['auth'] == 1) checked @endif>正常
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label>头像</label>
                    <div class="fileupload fileupload-new">
                        <label>
                            <span class="btn btn-file btn-default">
                                <input type="file" name="face">
                            </span>
                        </label>
                    </div>
                </div>
                <input type="hidden" name="_method" value="put">
                {{csrf_field()}}
                <button type="submit" class="btn btn-info">修改</button>
            </form>
        </div>
    </div>
</div>
@endsection